home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Demos / ByCompany / Schema_Research / SchemaE / SchemaE.app / Reports / Sybase_Table.sqrl < prev    next >
Text File  |  1994-03-30  |  1KB  |  54 lines

  1. template "Sybase_Table.rtf" quotes "[" "]"
  2. app "Edit"
  3.  
  4. repeat [ /* for each table */
  5.     objectid int,
  6.     name string
  7.     using [ select id, name 
  8.             from sysobjects
  9.             where type = 'U' and name not in ("edcomment","edicon","edobject","edcolumn","edkey") order by name ]
  10.  
  11.     repeat [ /* for each table print the table comments */
  12.             tcomment string
  13.             using [select edcomment.comment
  14.                 from edcomment where
  15.                             edcomment.colid = 0
  16.                             and id = @objectid
  17.                             order by sequence]
  18.  
  19.  
  20. ]
  21.     repeat [ /* for each column of a table */
  22.     colname string,
  23.     datatype string,
  24.     length string,
  25.     colid int
  26.     /* column stuff string    */
  27.         using [select
  28.                 col_name = syscolumns.name,
  29.                 type_name = systypes.name,
  30.                 syscolumns.length,
  31.                 syscolumns.colid
  32.             from
  33.                 syscolumns,
  34.                 systypes
  35.             where
  36.                  systypes.usertype = syscolumns.usertype
  37.                 and syscolumns.id = @objectid
  38.                 order by colid
  39.                 ] /* using */
  40.  
  41.             repeat [ /* for each column print the comments */
  42.             comment string
  43.             using [select edcomment.comment
  44.                 from edcomment where
  45.                             edcomment.colid = @colid
  46.                             and id = @objectid
  47.                             order by sequence
  48.             ]]
  49.  
  50.             ] /* column */
  51.  
  52.  
  53. ] /* for each table */
  54.